<%
  #File:    /app/views/manage/pages/_form.rhtml
  #Author:  Andrew Stone
  #Created: 05.31.2006
  title = "Creating Page"
  title = "Updating Page Id: #{@page.id}" if @page.id
  action = "create"
  action = "update" if @page.id
%>
<%=javascript_include_tiny_mce %>
<%=tiny_mce%>

<%=error_messages_for("page")%>

<%=start_form_tag(:action => action)%>

<%=start_large_div_wrapper%>
  <div id="page_title"><%=title%></div>
  <div id="large">
    <div id="page_left">
      <table>
        <tbody>
          <tr>
            <td class="req_label">* Page Title:</td>
            <td class="data"><%=text_field("page","title")%></td>
          </tr>
          <tr>
            <td class="req_label">* Folder:</td>
            <td class="data">
              <select id="page_folder_id" name="page_folder_id">
                <option/>
                <%
                  Folder.list_for_selection.each do |parent|
                    selected = ""
                    selected = "selected='selected'" if parent[:id] == @page.current_folder_id %> 
                    <option value="<%=parent[:id]%>" <%=selected%>><%=parent[:name]%></option>
                <%
                  end %>
              </select>
            </td>
          </tr>
          <tr><td colspan="4">&nbsp;</td> </tr>
        </tbody>
      </table>
    </div>
    <div id="page_right">
      <label for="page_is_featured"><%=check_box("page","is_featured")%><strong>* Is Featured?</strong></label> <br/><br/>
      <label for="page_show_in_footer"><%=check_box("page","show_in_footer")%><strong>* Show in Footer?</strong></label><br/><br/>
      <label for="page_do_hide"><%=check_box("page","do_hide")%><strong>* Hide?</strong></label><br/><br/>
      <label for="page_enabled"><%=check_box("page","enabled")%><strong>* Enabled?</strong></label>
    </div>
    <div style="clear: both">&nbsp;</div>
    <table>
      <tbody>
        <tr>
          <td>
            <%=text_area("page","content",{:cols => 88, :rows => 40})%>
          </td>
        </tr>
      </tbody>
    </table>
    <div style="clear: both">&nbsp;</div>
    <%=hidden_field("page","id")%>
    <div id="actions">
      <%=submit_tag("Cancel")%>
      <%=submit_tag(action.capitalize)%>
    </div>
  </div>
<%=end_div_wrapper%>
<%=end_form_tag%>

